-- GENERATED SPELL FOR [Drakkari Commander] --


function spell0_27431(pUnit, Event) --@Battle Shout,Self--
pUnit:FullCastSpellOnTarget(49724,pUnit)
pUnit:RegisterEvent('Sorts_27431', 30318, 1)
end

function spell1_27431(pUnit, Event) --@Frenzy,Self--
pUnit:FullCastSpellOnTarget(8269,pUnit)
pUnit:RegisterEvent('Sorts_27431', 646, 1)
end

function spell2_27431(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(15578,pUnit)
pUnit:RegisterEvent('Sorts_27431', 582, 1)
end

function spell3_27431(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(15589,pUnit)
pUnit:RegisterEvent('Sorts_27431', 580, 1)
end

function spell4_27431(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(24236,pUnit)
pUnit:RegisterEvent('Sorts_27431', 2000, 1)
end

function spell5_27431(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(49807,pUnit)
pUnit:RegisterEvent('Sorts_27431', 2000, 1)
end

function Sorts_27431(pUnit, Event)
local choix_sorts_27431 = math.random(0, 5)
if choix_sorts_27431 == 0 then
pUnit:RegisterEvent('spell0_27431', 1, 1)
end
if choix_sorts_27431 == 1 then
pUnit:RegisterEvent('spell1_27431', 1, 1)
end
if choix_sorts_27431 == 2 then
pUnit:RegisterEvent('spell2_27431', 1, 1)
end
if choix_sorts_27431 == 3 then
pUnit:RegisterEvent('spell3_27431', 1, 1)
end
if choix_sorts_27431 == 4 then
pUnit:RegisterEvent('spell4_27431', 1, 1)
end
if choix_sorts_27431 == 5 then
pUnit:RegisterEvent('spell5_27431', 1, 1)
end
end

function mob27431_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_27431', math.random(1500, 3000), 1)
end

function mob27431_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob27431_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob27431_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(27431, 1, 'mob27431_Action')
RegisterUnitEvent(27431, 2, 'mob27431_Leave')
RegisterUnitEvent(27431, 3, 'mob27431_Kill')
RegisterUnitEvent(27431, 4, 'mob27431_Die')
